<html>
<head><meta charset="utf-8"><title>unsafe blocks in unsafe fn · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html">unsafe blocks in unsafe fn</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="186439447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186439447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186439447">(Jan 23 2020 at 21:45)</a>:</h4>
<p>hey <span class="user-mention" data-user-id="239881">@Josh Triplett</span> , regarding your <a href="https://github.com/rust-lang/rfcs/pull/2585#issuecomment-577852430" target="_blank" title="https://github.com/rust-lang/rfcs/pull/2585#issuecomment-577852430">recent comment</a>: does that mean you would be in favor of <code>#[unsafe] fn foo</code> if it were written <code>#[unsafe_to_call] fn foo</code> or something similar?</p>



<a name="186439553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186439553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186439553">(Jan 23 2020 at 21:46)</a>:</h4>
<p>(I decided not to keep pushing <code>#[unsafe]</code> in the meeting because it seemed like few people were interested in pursuing that avenue of discussion, but I don't think you chimed in at that time.)</p>



<a name="186439679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186439679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186439679">(Jan 23 2020 at 21:47)</a>:</h4>
<p>the idea was originally proposed by ogoffart <a href="https://github.com/rust-lang/rfcs/pull/2585#issuecomment-511313773" target="_blank" title="https://github.com/rust-lang/rfcs/pull/2585#issuecomment-511313773">here</a> on the RFC thread</p>



<a name="186439826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186439826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186439826">(Jan 23 2020 at 21:48)</a>:</h4>
<p>(though I don't know if I agree with their generalization to <code>#[unsafe] trait UnsafeTrait { }</code> ; that seems premature to me, especially since I think <code>unsafe trait</code> has  no implied effect on its methods and default bodies.)</p>



<a name="186440630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186440630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186440630">(Jan 23 2020 at 21:57)</a>:</h4>
<p>(that is, I don't see what the use of the attribute form buys one in terms of expressiveness there; at least with the <code>#[unsafe] fn</code> I can see how it differs from <code>unsafe fn</code>)</p>



<a name="186440829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186440829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186440829">(Jan 23 2020 at 21:59)</a>:</h4>
<p>I would be slightly in favor, albeit that's a very verbose syntax.</p>



<a name="186440868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186440868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186440868">(Jan 23 2020 at 21:59)</a>:</h4>
<p><code>#[unsafe_to_call] fn</code> is verbose? or <code>#[unsafe] fn</code>?</p>



<a name="186440883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186440883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186440883">(Jan 23 2020 at 21:59)</a>:</h4>
<p>The former.</p>



<a name="186440948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186440948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186440948">(Jan 23 2020 at 22:00)</a>:</h4>
<p>okay.But I assume the latter fails to convey intent sufficiently, right ?</p>



<a name="186440975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186440975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186440975">(Jan 23 2020 at 22:00)</a>:</h4>
<p>Yeah, confusing similarity.</p>



<a name="186441010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441010">(Jan 23 2020 at 22:00)</a>:</h4>
<p>I don't have a good syntax to suggest.</p>



<a name="186441017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441017">(Jan 23 2020 at 22:00)</a>:</h4>
<p>another option that <span class="user-mention" data-user-id="120791">@RalfJ</span> had put forward was something like <code>#[safe_body] unsafe fn foo(..) { ... }</code></p>



<a name="186441059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441059">(Jan 23 2020 at 22:01)</a>:</h4>
<p>I prefer the lint approach. But I like the concept of <code>#[unsafe_to_call]</code>, just not the spelling.</p>



<a name="186441077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441077">(Jan 23 2020 at 22:01)</a>:</h4>
<p>which is again verbose, but perhaps captures intent nicely (especially since the fact that the body is safe is an <em>implementation</em> detail, and thus need not be part of the header.</p>



<a name="186441149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441149">(Jan 23 2020 at 22:02)</a>:</h4>
<p>I.e. maybe we could get away with adding <code>#[safe]</code>, and do <code>unsafe fn foo(...) { #![safe] ... }</code></p>



<a name="186441176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441176">(Jan 23 2020 at 22:02)</a>:</h4>
<p>which sidesteps the whole failure to reserve <code>safe</code> as a keyword.</p>



<a name="186441250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441250">(Jan 23 2020 at 22:03)</a>:</h4>
<p>and of course its quite likely that all of this was already debated on the RFC</p>



<a name="186441353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441353">(Jan 23 2020 at 22:04)</a>:</h4>
<p>could some sort of synonym help here?</p>



<a name="186441400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441400">(Jan 23 2020 at 22:05)</a>:</h4>
<p>I suppose <code>#![safe]</code> ends up turning into the lint approach</p>



<a name="186441526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441526">(Jan 23 2020 at 22:06)</a>:</h4>
<p>i.e. <code>unsafe fn foo(...) { #![safe] ... }</code> seems like it would be equivalent to <code>unsafe fn foo(...) { #![deny(unsafe_acts_outside_unsafe_block)] ...}</code>, or whatever we name the lint.</p>



<a name="186441605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441605">(Jan 23 2020 at 22:07)</a>:</h4>
<p>something like <code>danger fn set_len(&amp;self, new_len)</code></p>



<a name="186441771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441771">(Jan 23 2020 at 22:09)</a>:</h4>
<p>i'll admit I don't see why we need a new keyword for this concept. An attribute (i.e. <code>#[danger] fn set_len(&amp;mut self, new_len)</code> seems fine to me.)</p>



<a name="186441876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441876">(Jan 23 2020 at 22:10)</a>:</h4>
<p>(as long as adding the attribute cannot make us start accepting code with UB that would have otherwise been rejected, that is )</p>



<a name="186441917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186441917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186441917">(Jan 23 2020 at 22:11)</a>:</h4>
<p>attributes are often quite clunky, but since it's infrequent that this one would be used it's probably fine</p>



<a name="186442071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186442071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186442071">(Jan 23 2020 at 22:12)</a>:</h4>
<p>I think adding attributes (particularly <code>#[unsafe]</code> due to its keyword nature) or wholly new mechanisms rather than small edition based tweaks uses up relatively a lot of spec/compiler complexity for relatively little gain as <code>#[unsafe/safe/unsafe_to_call]</code> is unlikely to get widespread use</p>



<a name="186442112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186442112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186442112">(Jan 23 2020 at 22:13)</a>:</h4>
<p>If we don't make edition changes as proposed in the RFC, I would prefer to tweak the linting, and leave it there</p>



<a name="186443310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186443310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186443310">(Jan 23 2020 at 22:28)</a>:</h4>
<p>Specifically an attribute<br>
1) displays poorly in generated rustdoc (relatively fixable)<br>
2) doesn't have a defined order when there is more than one on the same function (harder to fix but maybe rustfmt could help)</p>
<p>example: set_len is probably inline, and you could imagine must_use being added to other unsafe to call functions that are inline, such as index_unchecked or similar.</p>
<p>Many disorganized attributes is fine if they are largely unimportant to the usage, such as inline being optimization only, and must_use being a hint only. When the attribute means that you need an unsafe block and you need to be manually verifying things, it is not so fun.</p>



<a name="186443392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186443392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186443392">(Jan 23 2020 at 22:29)</a>:</h4>
<p>put another way: safe / unsafe_to_call_but_safe_body / unsafe_body is as important as async, and async is not an attribute either.</p>



<a name="186443557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186443557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186443557">(Jan 23 2020 at 22:32)</a>:</h4>
<p>if not more important due to the well.. unsafety</p>



<a name="186554104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186554104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186554104">(Jan 25 2020 at 02:58)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> if you saw it in the RFC thread, how did you feel about the suggestion of allowing <code>unsafe</code> to prefix a single expression without need of braces:</p>
<div class="codehilite"><pre><span></span><span class="k">unsafe</span><span class="w"> </span><span class="n">v</span><span class="p">.</span><span class="n">set_len</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">x_val</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="o">*</span><span class="n">x</span><span class="p">;</span><span class="w"></span>
<span class="c1">// and so on</span>
</pre></div>



<a name="186554108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186554108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186554108">(Jan 25 2020 at 02:59)</a>:</h4>
<p>Did see it, really not a fan. Unsafe should stand out.</p>



<a name="186554170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186554170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186554170">(Jan 25 2020 at 03:00)</a>:</h4>
<p>that makes it harder to program much of the time :/</p>



<a name="186554180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186554180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186554180">(Jan 25 2020 at 03:01)</a>:</h4>
<p>i think it especially hinders calls where the return value is immediately checked with if or match</p>



<a name="186554227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/186554227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#186554227">(Jan 25 2020 at 03:02)</a>:</h4>
<p>which is like, 97% of all the unsafe calls i make</p>



<a name="187278905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/unsafe%20blocks%20in%20unsafe%20fn/near/187278905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/unsafe.20blocks.20in.20unsafe.20fn.html#187278905">(Feb 03 2020 at 16:35)</a>:</h4>
<p>we opted against this "braceless unsafe" in the past on the basis of the non-obviousness of its scope (this, btw, is a good example of the kind of "jurispredunce" I think we should be accumulating in a sort of FAQ)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>